gh-130132: add an explicit close() call to urlopen examples without with#130280
Conversation
|
Thanks for correcting the missing close() bug in one example, there are 2 remaining. |
Thanks @opk12 for suggestions, added it in the remaining examples. |
|
@sobolevn I have made the requested changes; please review again. |
|
Thanks for making the requested changes! : please review the changes made to this pull request. |
|
@sobolevn I have made the requested changes; please review again. |
|
Thanks for making the requested changes! : please review the changes made to this pull request. |
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: sobolevn <mail@sobolevn.me>
Mr-Sunglasses
left a comment
There was a problem hiding this comment.
@sobolevn I have made the requested changes; please review again.
picnixz
left a comment
There was a problem hiding this comment.
There are some usages of opener.open (L1319, L1340) that could be in a "with". Please check the entire file with occurrences of open and urlopen. TiA.
Mr-Sunglasses
left a comment
There was a problem hiding this comment.
@picnixz I've make the requested changes. please review again 😄 .
TiA. 🙏🏻
Other examples use `f` as the response variable.
|
Thanks @Mr-Sunglasses for the PR, and @picnixz for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
…pythonGH-130280) (cherry picked from commit 77d2fd4) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-131394 is a backport of this pull request to the 3.13 branch. |
…pythonGH-130280) (cherry picked from commit 77d2fd4) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
GH-131395 is a backport of this pull request to the 3.12 branch. |
GH-130280) (#131394) gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280) (cherry picked from commit 77d2fd4) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
GH-130280) (#131395) gh-130132: properly free resources in `urrlib.urlopen` examples (GH-130280) (cherry picked from commit 77d2fd4) Co-authored-by: Kanishk Pachauri <itskanishkp.py@gmail.com> Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
…python#130280) Co-authored-by: sobolevn <mail@sobolevn.me> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
fix: #130132
close()call tourlopenexamples withoutwith#130132📚 Documentation preview 📚: https://cpython-previews--130280.org.readthedocs.build/